package com.x.erp.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.x.erp.dao.CarMileageDao;
import com.x.erp.model.CarMileage;
import com.x.erp.rpc.CarMileageRpcService;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;

/**
 * 车辆里程区间服务
 */
@Component
@Service(interfaceName = "com.x.erp.rpc.CarMileageRpcService", timeout = 60000)
public class CarMileageService extends BaseService implements CarMileageRpcService {

	@Autowired
	private CarMileageDao carMileageDao;// 车辆里程区间信息DAO

	/**
	 * 查询车辆里程区间列表
	 * 
	 * @param carMileage
	 * @return
	 */
	@Override
	public List<CarMileage> selectCarMileageList(CarMileage carMileage) {
		try {
			return carMileageDao.selectCarMileageList(carMileage);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}
}
